/* 页面标题样式 */
.page-title {
    text-align: center;
    margin: 40px 0;
    font-size: 32px;
    color: #333;
}

/* 布局容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    min-height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 100px;
}

/* 生成器布局 */
.generator-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

/* 表单区域 */
.generator-form {
    padding: 30px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border-radius: 18px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 表单组件样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

/* 下拉框基础样式 */
select {
    width: 100%;
    text-align: center;
    text-align-last: center;
    padding: 10px 30px 10px 10px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    background: white;
    font-size: 16px;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    cursor: pointer;
}

/* 输入框基础样式 */
input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    background: white;
    font-size: 16px;
}

select option {
    background-color: white;
    color: #333;
    padding: 8px;
    text-align: left;
}

/* 深色模式下拉框样式 */
body.dark-mode select {
    background-color: rgba(51, 51, 51, 0.9);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}

body.dark-mode select option {
    background-color: #333;
    color: white;
}

/* Firefox 特定样式 */
@-moz-document url-prefix() {
    body.dark-mode select {
        background-color: #333;
    }
    
    body.dark-mode select option {
        background-color: #333;
        color: white;
    }
}

/* Webkit (Chrome/Safari) 特定样式 */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    body.dark-mode select {
        background-color: #333;
    }
    
    body.dark-mode select option {
        background-color: #333;
        color: white;
    }
}

/* 日期选择器组样式 */
.date-group label {
    margin-bottom: 12px;
}

.date-inputs {
    display: flex;
    gap: 10px;
}

.date-input {
    flex: 1;
}

/* 单选按钮组样式 */
.radio-group {
    display: flex;
    gap: 20px;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

/* 按钮组样式 */
.button-group {
    padding: 20px;
}

/* 按钮容器 */
.action-buttons {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* 数量输入框容器 */
.count-input {
    min-width: 180px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.count-input label {
    font-size: 14px;
    color: #666;
    white-space: nowrap;
}

/* 数量输入框 */
.batch-input {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    text-align: center;
    font-size: 16px;
    height: 44px;
}

/* 统一按钮样式 */
.generate-btn,
.copy-btn {
    flex: 1;
    height: 44px;
    padding: 0 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

/* 生成按钮 */
.generate-btn {
    background: #007aff;
    color: white;
}

.generate-btn:hover {
    background: #0056b3;
}

/* 复制按钮 */
.copy-btn {
    background: #28a745;
    color: white;
}

.copy-btn:hover {
    background: #218838;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .action-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .count-input {
        width: 100%;
        min-width: unset;
    }

    .generate-btn,
    .copy-btn {
        width: 100%;
        height: 40px;
    }
}

/* 结果展示区域 */
.result-panel {
    padding: 30px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border-radius: 18px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.result {
    margin-bottom: 20px;
}

.result textarea {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    font-family: monospace;
    font-size: 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    resize: vertical;
    background: white;
    line-height: 1.5;
}

.copy-btn {
    width: 100%;
    padding: 10px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.copy-btn:hover {
    background: #218838;
}

/* 历史记录样式 */
.history {
    margin-top: 20px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.history-header h3 {
    margin: 0;
    font-size: 16px;
}

.history ul {
    list-style: none;
    padding: 0;
    max-height: 300px;
    overflow-y: auto;
}

.history li {
    padding: 8px;
    background: rgba(255, 255, 255, 0.5);
    margin-bottom: 5px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 14px;
    word-break: break-all;
}

/* 清除按钮样式 */
.clear-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #666;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.clear-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #ff4d4f;
}

/* 清除按钮动画 */
@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(180deg); }
}

.clear-btn.rotating svg {
    animation: rotate 0.5s ease;
}

/* 主题切换按钮 */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.theme-toggle:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .theme-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* 深色模式样式 */
body.dark-mode .page-title {
    color: #fff;
}

body.dark-mode .generator-form,
body.dark-mode .result-panel {
    background: rgba(255, 255, 255, 0.1);
}

body.dark-mode select,
body.dark-mode input[type="text"],
body.dark-mode .batch-input {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
}

body.dark-mode .result textarea {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
}

body.dark-mode .history li {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

body.dark-mode .clear-btn {
    color: #999;
}

body.dark-mode .clear-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ff4d4f;
}

body.dark-mode .form-group label {
    color: #fff;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    .page-title {
        margin: 20px 0;
        font-size: 24px;
    }

    .button-group {
        flex-direction: column;
        padding: 10px;
        gap: 10px;
    }

    .batch-control {
        width: 100%;
    }

    .batch-input {
        flex: 1;
        max-width: 100px;
    }

    .generate-btn,
    .batch-btn,
    .copy-btn {
        width: 100%;
        height: 40px;
        min-width: unset;
    }
}

/* 地区选择器组样式 */
.area-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.area-group .form-group {
    flex: 1;
    margin-bottom: 0;
}

/* 调整地区选择器的宽度比例 */
.area-group .form-group:nth-child(1) { /* 省份 */
    flex: 1.2;
}

.area-group .form-group:nth-child(2) { /* 城市 */
    flex: 1;
}

.area-group .form-group:nth-child(3) { /* 区县 */
    flex: 1;
}

/* 响应式设计补充 */
@media (max-width: 768px) {
    .area-group {
        flex-direction: column;
        gap: 15px;
    }
    
    .area-group .form-group {
        width: 100%;
    }
}

/* 固定标题区域 */
.fixed-header {
    padding: 20px 0;
    min-height: 100px;
    position: relative;
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.header-content h1 {
    margin: 0 0 10px 0;
}

.header-content p {
    margin: 0;
    opacity: 0.8;
}

/* 深色模式适配 */
body.dark-mode .fixed-header {
    background: rgba(33, 33, 33, 0.95);
}

body.dark-mode .header-content h1 {
    color: #fff;
}

body.dark-mode .header-content p {
    color: #999;
}

/* 响应式设计补充 */
@media (max-width: 768px) {
    .header-content {
        padding: 10px 15px;
    }

    .header-content h1 {
        font-size: 20px;
    }

    .header-content p {
        font-size: 12px;
    }

    .container {
        padding-top: 80px;
    }
}

/* 日期输入框样式 */
.date-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-size: 16px;
    text-align: center;
    background: white;
}

.date-group input::placeholder {
    color: #999;
    font-size: 14px;
}

/* 日期输入框验证样式 */
.date-group input:invalid {
    border-color: #ff4d4f;
}

.date-group input:focus {
    outline: none;
    border-color: #007aff;
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.1);
}

/* 深色模式适配 */
body.dark-mode .date-group input {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
}

body.dark-mode .date-group input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

body.dark-mode .date-group input:focus {
    border-color: #007aff;
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.2);
}

/* 信息组样式 */
.info-group {
    display: flex;
    gap: 20px;
}

.date-section {
    flex: 2;
}

.gender-section {
    flex: 1;
}

/* 响应式设计补充 */
@media (max-width: 768px) {
    .info-group {
        flex-direction: column;
        gap: 15px;
    }
}

/* 深色模式适配 */
body.dark-mode .count-control label {
    color: #999;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .action-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .generate-btn,
    .batch-btn,
    .copy-btn {
        width: 100%;
        height: 40px;
    }
}

/* 深色模式适配 */
body.dark-mode .count-input label {
    color: #999;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .count-input {
        width: 100%;
        min-width: unset;
    }
}

/* 返回按钮样式 */
.back-button {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.back-button:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

/* 暗色主题适配 */
[data-theme="dark"] .back-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
} 